//
// Created by lidongwei on 2023/6/14.
//
///////////////////预处理/////////////////
#ifndef INFER_PRETREATMENT_H
#define INFER_PRETREATMENT_H

#include "opencv2/opencv.hpp"
#include "cuda_runtime.h"
#include <math.h>
#include "stdio.h"
#include <cstring>
#include "cuda_def.h"

//#define checkRuntime(op)  __check_cuda_runtime((op), #op, __FILE__, __LINE__)
//bool __check_cuda_runtime(cudaError_t code, const char *op, const char *file, float line);//cuda异常检测模块

typedef unsigned char uint8_t;

#define min(a, b) a<b ? a : b
#define max(a, b) a>b ? a : b
namespace handle {//定义处理模块

    class pretreatment {//预处理模块
    public:
        static cv::Mat Affine_transformation(cv::Mat img, cv::Size output_size, float theta, int mode);//仿射变换

        static cv::Mat HWC2CHW(cv::Mat img);//HWC转CHW
        static cv::Mat CHW2HWC(cv::Mat img);//CHW转HWC

        static std::vector<float> Normalization(cv::Mat img,int Normalization,int channels);//归一化


    };

}


#endif //INFER_PRETREATMENT_H
